package com.ruoyix.ai.controller;


import org.springframework.ai.ollama.OllamaChatModel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ollama/chat")
public class OllamaChatController {


    @Autowired
    private OllamaChatModel chatModel;

    @GetMapping("/generate")
    public String generate(String promot){
//        ChatResponse response = chatModel.call(
//                new Prompt(
//                        promot,
//                        OllamaOptions.create()
//                                .withModel("qwen:7b")
//                                .withTemperature(0.4F)
//                ));
        return chatModel.call(promot);
    }
}
